home *** CD-ROM | disk | FTP | other *** search
- 10 ! ******************************************************************
- 20 ! Example: Background Bitmap
- 30 !
- 40 ! This program demonstrates the BACKGROUND BITMAP attribute
- 50 ! of the PANEL widget by allowing you to bring in a bitmap
- 60 ! file and use it to tile the PANEL.
- 70 !
- 80 ! ******************************************************************
- 90 !
- 100 ! Some variables:
- 110 !
- 120 ! S$: String variable
- 130 ! M$: SYSTEM MENU array
- 140 ! F$: Bitmap file name
- 150 ! N: INTEGER variable
- 160 ! Btn: Variable to get button inputs from dialogs
- 170 ! D(*): Array to get display dimensions
- 180 ! Dw,Dh: Display dimensions
- 190 !
- 200 DIM S$[256],M$(0:1)[32],F$[50]
- 210 INTEGER N,Btn,D(1:4),Dw,Dh
- 220 !
- 230 ! Get display size
- 240 !
- 250 GESCAPE CRT,3;D(*)! Gets display lines
- 260 Dw=D(3)-D(1)
- 270 Dh=(D(4)-D(2))
- 280 !
- 290 ! Set up SYSTEM MENU array
- 300 !
- 310 M$(0)="Get Bitmap File"
- 320 M$(1)="Quit"
- 330 !
- 340 ! Create the PANEL widget, add a toaster menu
- 350 !
- 360 CLEAR SCREEN
- 370 ASSIGN @Main TO WIDGET "PANEL";SET ("VISIBLE":0)
- 380 CONTROL @Main;SET ("X":50,"Y":20,"WIDTH":.8*Dw,"HEIGHT":.8*Dh)
- 390 CONTROL @Main;SET ("MAXIMIZABLE":0,"RESIZABLE":0)
- 400 CONTROL @Main;SET ("TITLE":" Example: Background Bitmap")
- 410 CONTROL @Main;SET ("SYSTEM MENU":M$(*),"VISIBLE":1)
- 420 !
- 430 ON EVENT @Main,"SYSTEM MENU" GOSUB Handler
- 440 LOOP
- 450 WAIT FOR EVENT
- 460 END LOOP
- 470 STOP
- 480 !
- 490 ! ***************** End of Main Program ***********************
- 500 !
- 510 Handler:!
- 520 STATUS @Main;RETURN ("SYSTEM MENU EVENT":N)
- 530 SELECT N
- 540 CASE 0
- 550 S$="Please enter bitmap file name:"
- 560 DIALOG "FILE",S$,Btn;RETURN ("SELECTION":F$)
- 570 IF Btn=0 THEN
- 580 CLEAR ERROR
- 590 ON ERROR GOSUB Errtrap
- 600 CONTROL @Main;SET ("BACKGROUND BITMAP":F$)
- 610 OFF ERROR
- 620 IF ERRN<>0 THEN DIALOG "ERROR",ERRM$
- 630 END IF
- 640 CASE 1
- 650 GOTO Finis
- 660 END SELECT
- 670 RETURN
- 680 !
- 690 Errtrap: ERROR RETURN
- 700 !
- 710 Finis:!
- 720 ASSIGN @Main TO *! Delete PANEL Widget
- 730 END
-